package com.lianbang.pharmacy.module.user

import android.app.Activity
import android.content.Context
import android.content.Intent
import cn.ubest.mvvmcore.base.BaseActivity
import com.lianbang.pharmacy.R
import com.lianbang.pharmacy.databinding.ActivityLoginBinding
import com.lianbang.pharmacy.module.main.MainActivity
import com.lianbang.pharmacy.vm.UserVM
import kotlinx.android.synthetic.main.activity_login.*

/**
 * Created by maoqi on 2020/12/28.
 */
class LoginActivity : BaseActivity<UserVM, ActivityLoginBinding>() {

    companion object {
        fun start(context: Context?){
            context?.also {
                val starter = Intent(it, LoginActivity::class.java)
                if (it !is Activity) {
                    starter.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
                }
                it.startActivity(starter)
            }
        }
    }

    override fun initLayout(): Int {
        return R.layout.activity_login
    }

    override fun initData(intent: Intent) {
    }

    override fun initView() {
        btn_login.setOnClickListener {
            mViewModel.login("", "")
        }
    }

    override fun loadData() {

    }

}